<template>
  <el-tabs type="border-card" v-model="tabValues" :before-leave="beforeLeave">
    <el-tab-pane name="1">
      <template #label>
        <span>
          <el-icon><Setting /></el-icon>
          品号设置
        </span>
      </template>
      <sales-rebate-setting ref="setting"></sales-rebate-setting>
    </el-tab-pane>
    <el-tab-pane name="2">
      <template #label>
        <span>
          <el-icon><Edit /></el-icon>
          单据清单
        </span>
      </template>
      <sales-rebate-inventory ref="inventory"></sales-rebate-inventory>
    </el-tab-pane>
    <!--    <el-tab-pane name="4">-->
    <!--      <div slot="label" @click.stop="">-->
    <!--        <el-form inline>-->
    <!--          <el-form-item>-->
    <!--            <el-button size="small" type="warning" @click="httpPrint">打印</el-button>-->
    <!--          </el-form-item>-->

    <!--          <el-form-item>-->
    <!--            <el-dropdown @command="handleClick">-->
    <!--              <el-button type="success" size="small">-->
    <!--                预览<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
    <!--              </el-button>-->
    <!--              <el-dropdown-menu slot="dropdown">-->
    <!--                <el-dropdown-item command="1">销售开单</el-dropdown-item>-->
    <!--                <el-dropdown-item command="2">单据明细</el-dropdown-item>-->
    <!--                <el-dropdown-item command="3">批量打印单据</el-dropdown-item>-->
    <!--              </el-dropdown-menu>-->
    <!--            </el-dropdown>-->
    <!--          </el-form-item>-->

    <!--        </el-form>-->
    <!--      </div>-->
    <!--    </el-tab-pane>-->
  </el-tabs>
</template>

<script lang="ts" setup>
import {ref, nextTick} from "vue";
import SalesRebateInventory from './SalesRebateInventory.vue'
import SalesRebateSetting from './SalesRebateSetting.vue'
import {Edit} from "@element-plus/icons-vue";

const inventory = ref(null)
const setting = ref(null)

const tabValues = ref("2")

const beforeLeave = async (newVal, oldVal) => {
  if (newVal === '3') {
    await nextTick(() => {

    })
  }
}
</script>

<style scoped>

</style>
